<template>
  <div class="login">
    <div class="title">
      <span>账号登录</span>
    </div>
    <div class="bgimg">
      <img src="./assets/login.png" alt="" />
    </div>
    <div class="phone">
      <span>手机号</span>
      <input v-model="phone" type="text" placeholder="请输入手机号" />
    </div>
    <div class="code phone">
      <span>验证码</span>
      <input v-model="code" type="text" placeholder="请输入验证码" />
      <div class="getcode">
        <span>获取验证码</span>
      </div>
      <!-- <div class="getcode send">
        <span>已发送（60s）</span>
      </div> -->
    </div>
    <!-- active-btn -->
    <div class="btn" :class="isActiveBtn ? 'active-btn' : ''">登录</div>
  </div>
</template>

<script setup>
import { ref, reactive, watch } from "vue";
const phone = ref("");
const code = ref("");
const isActiveBtn = ref(false);

watch([phone, code], (newVal) => {
  let [phone, code] = newVal;
  phone && code ? (isActiveBtn.value = true) : (isActiveBtn.value = false);
});
</script>
<script>
export default {
  name: "login",
};
</script>

<style lang="less" scoped>
.login {
  box-sizing: border-box;
  padding: 0 30px;
  background: linear-gradient(140deg, #ffefd6 7.13%, #fff 25.52%);
  height: 100vh;
  position: relative;
  .title {
    padding-top: 72px;
    color: #333;
    font-family: PingFang SC;
    font-size: 32px;
    font-style: normal;
    font-weight: 500;
  }
  .bgimg {
    position: absolute;
    top: 68px;
    right: 30px;
    img {
      width: 148px;
      height: 99px;
    }
  }
  .phone {
    margin-top: 28px;
    display: flex;
    flex-direction: column;
    span {
      color: #333;
      font-family: PingFang SC;
      font-size: 14px;
      font-style: normal;
      font-weight: 400;
    }
    input {
      box-sizing: border-box;
      height: 48px;
      padding: 12px 0;
      border: 0;
      border-bottom: 1px solid #e7e7e7;
      background-color: transparent;
      outline: none;
      color: #333;
      font-family: Arial;
      font-size: 16px;
      font-style: normal;
      font-weight: 700;
      &::placeholder {
        color: #999;
        font-family: PingFang SC;
        font-size: 16px;
        font-style: normal;
        font-weight: 400;
      }
    }
  }
  .code {
    position: relative;
    .getcode {
      position: absolute;
      bottom: 18px;
      right: 0px;
      font-size: 14px;
      border-left: 1px solid #ff9200;
      span {
        color: #ff9200;
        margin-left: 5px;
      }
    }
    .send {
      border-left: 1px solid #999999;
      span {
        color: #999999;
      }
    }
  }
  .btn {
    width: 100%;
    height: 44px;
    background-color: #cccccc;
    line-height: 44px;
    text-align: center;
    border-radius: 22px;
    color: #fff;
    margin-top: 44px;
  }
  .active-btn {
    background: linear-gradient(90deg, #ffd500 1.85%, #ff9900 100%);
  }
}
</style>
